using System;
using Microsoft.Xna.Framework;

namespace GameEngine.Units
{
	public class Die : Action
	{
		private long time;
		public Die(Unit owner)
			: base(owner)
		{
			this.time = new TimeSpan(0, 0, 0, 2, 900).Ticks;
		}
		protected internal override bool Update(ref GameTime gameTime)
		{
			// TODO: Copied from Attack. Consider adding methods to provide the ellapsed time here in the Action class
			time = time - gameTime.ElapsedGameTime.Ticks;
			this.Owner.PlayAnimation("Die");
			if (time <= 0)
			{
				this.Owner.IsDecayed = true;
			}
			return time <= 0;
		}
	}
}
